package com.project.thisDatabase.base.mapper;

import com.project.thisDatabase.base.model.EntityBase;
import com.project.thisDatabase.base.model.entities.IntResultEntity;
import com.project.thisDatabase.base.model.entities.PageEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BaseMapper<T extends EntityBase> extends com.baomidou.mybatisplus.core.mapper.BaseMapper<T> {

    List<T> search(T entity);
    List<T> searchPage(@Param("entityItem") T entityItem, @Param("pageItem") PageEntity pageItem);
    Integer edit(@Param("entityItem") T entity, @Param("valueItem") T val);
    Integer add(T entity);
    Integer updateAll(@Param("entityItem") T entity, @Param("valueItem") T val);
    IntResultEntity count(T entity);
    Integer insertOrUpdate(T entity);

    List<T> searchAut(T entity);
    List<T> searchPageAut(@Param("entityItem") T entityItem, @Param("pageItem") PageEntity pageItem);
    Integer updateAut(@Param("entityItem") T entity, @Param("valueItem") T val);
    IntResultEntity countAut(T entity);

    int deleteAut(T entity);
}
